package com.gxa.controller.baoBiaoController;

import com.gxa.common.R;
import com.gxa.pojo.*;
import com.gxa.service.baoBiaoService.CaiGouBaoBiaoService;
import com.gxa.service.baoBiaoService.CangCunBaoBiaoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;

/**
 * @author 86156
 */
@RestController
@RequestMapping("/baoBiao/cangCunBaoBiao")
@Api(value = "仓存报表功能",tags = "仓存报表功能API")
@RequiresPermissions("仓存报表")
public class CangCunBaoBiaoController {


    @Autowired
    private CangCunBaoBiaoService cangCunBaoBiaoService;

    @GetMapping(value = "/selectShangPinShouFaMingXi")
    @ApiOperation(value = "商品收发明细表接口",notes = "接受参数，根据参数返回商品收发明细",httpMethod = "get", response =R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "startTime",value = "开始时间",paramType = "query",dataType = "String",required = true),
            @ApiImplicitParam(name = "endTime",value = "结束时间",paramType = "query",dataType = "String",required = true),
            @ApiImplicitParam(name = "cangKuId",value = "仓库id",paramType = "query",dataType = "String",required = false),
            @ApiImplicitParam(name = "shangPinId",value = "商品id",paramType = "query",dataType = "String",required = false)
    })
    public R selectShangPinShouFaMingXi(@RequestParam String startTime,
                                        @RequestParam String endTime,
                                        @RequestParam(required = false) String cangKuId,
                                        @RequestParam(required = false) String shangPinId) throws ParseException {

        return cangCunBaoBiaoService.selectShangPinShouFaMingXi(startTime,endTime,cangKuId,shangPinId);
    }
}
